package uoa.assignment.character;
import java.util.Random;

public class Monster extends GameCharacter {

	public  Monster(String name) {
		super(name);
	}


	public void hurtCharacter(GameCharacter character) {
        if(!character.successfulDefense())
		{
			character.setHealth(character.getHealth()-20);
		}
    }

	
	public boolean successfulDefense() {
		Random random= new Random();
		int chance=random.nextInt(100);
		return chance >= 50;
	}


	
	public String decideMove () {
		String []move=new String[4];
		move[0]="up";
		move[1]="down";
		move[2]="left";
		move[3]="right";
		Random random=new Random();
		int index=random.nextInt(4);
		return move[index];
	}

}
